package com.pet_service.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.pet_service.entity.RolePermission;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
* @author 邹全伸
* @description 针对表【role_permission(角色-权限关联表)】的数据库操作Mapper
* @createDate 2025-09-20 09:18:18
* @Entity com.pet_service.entity.RolePermission
*/
public interface RolePermissionMapper extends BaseMapper<RolePermission> {
    //批量删除角色权限关联表
    int deleteByRoleIdList(@Param("ids") List<Integer> ids);

    //先删除这个角色拥有的权限
    int deleteByRoleId(@Param("roleId")Integer roleId);

    //再重新添加权限
    int insertRolePermission(@Param("roleId") Integer roleId, @Param("checkedPermissionIdList") List<Integer> checkedPermissionIdList);

}




